<?php
require('./model/_connect.php');
header("Access-Control-Allow-Origin:*"); // 允许哪些域名请求我
header("Access-Control-Request-Methods:GET, POST, PUT, DELETE, OPTIONS"); // 允许哪些请求方式
header('Access-Control-Allow-Headers:x-requested-with,content-type,test-token,test-sessid'); // 允许携带哪些请求头信息
$id = $_REQUEST['id'];
//根据id删除数据
$sql = "DELETE FROM `cart` WHERE `product_id`='$id'";
$result = mysqli_query($conn,$sql);
if($result){
	echo json_encode(array("code"=>1));
}else{
	echo json_encode(array("code"=>0));
}

?>